<template>
  <div>
    <button @click="isShow = !isShow">点我显示/隐藏</button>
    <transition name="one">
      <h2 v-show="isShow">你好啊1！</h2>
    </transition>

    <transition name="two">
      <h2 v-show="isShow">你好啊2！</h2>
    </transition>
  </div>
</template>

<script>
  export default {
    name:'App',
    data() {
      return {
        isShow:true
      }
    },
  }
</script>

<style>
  * {
    margin: 0;
    padding: 0;
  }
  h2 {
    background-color: orange;
  }
  @keyframes atguigu {
      from{
          transform: translateX(0px);
      }
      to{
          transform: translateX(-100%);
      }
  }
  .one-enter-active {
    animation: 1s atguigu linear reverse;
  }
  .one-leave-active {
    animation: 1s atguigu linear;
  }
  .two-enter-active {
    animation: 3s atguigu linear reverse;
  }
  .two-leave-active {
    animation: 3s atguigu linear;
  }
</style>